<!DOCTYPE html>
<html>
	<head>
		<meta charset="{CHARSET}">
		<title></title>
		<script type="text/javascript">
			window.onload = function(){
				myTable = document.getElementById("mytable");
				//获取table中tr子节点
				trs = myTable.getElementsByTagName("tr");
				len = trs.length;
				flag = true;
				for(i = 0;i<len;i++){
					if(flag){
						trs[i].setAttribute("bgcolor","#cccccc");
						flag = false;
					}else{
						flag = true;
					}
				}
			}
		</script>
	</head>
	<body>
		<table id="mytable" align="center" width="80%" border="1">
			<tr bgcolor="#cccccc">
				<td>aaa</td><td>aaa</td><td>aaa</td>
			</tr>
			<tr>
				<td>bbb</td><td>bbb</td><td>bbb</td>
			</tr>
			<tr>
				<td>ccc</td><td>ccc</td><td>ccc</td>
			</tr>
			<tr>
				<td>ccc</td><td>ccc</td><td>ccc</td>
			</tr>
			<tr>
				<td>ccc</td><td>ccc</td><td>ccc</td>
			</tr>
			<tr>
				<td>ccc</td><td>ccc</td><td>ccc</td>
			</tr>
		</table>
	</body>
</html>
